<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
      <el-form-item label="任务名称" prop="taskName">
        <el-input
          v-model="queryParams.taskName"
          placeholder="请输入任务名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="调研水体名称" prop="surveyWaterBodyName">
        <el-select v-model="queryParams.surveyWaterBodyName" placeholder="请选择调研水体名称" clearable>
          <el-option
            v-for="dict in dict.type.survey_water_body_name"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="业务类别" prop="businessType">
        <el-select v-model="queryParams.businessType" placeholder="请选择业务类别" clearable>
          <el-option
            v-for="dict in dict.type.task_business_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="调研计划" prop="researchPlanId">
        <el-select v-model="queryParams.researchPlanId" placeholder="请选择调研计划" clearable>
          <el-option
            v-for="plan in researchPlanList"
            :key="plan.id"
            :label="plan.name"
            :value="plan.id"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="任务状态" prop="auditStatus">
        <el-select v-model="queryParams.auditStatus" placeholder="请选择任务状态" clearable>
          <el-option
            v-for="dict in dict.type.task_audit_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="数据来源" prop="source">
        <el-select v-model="queryParams.source" placeholder="请选择数据来源"
                   clearable
                   @keyup.enter.native="handleQuery">
          <el-option
            v-for="item in sourceOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['business:task:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:task:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:task:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['business:task:export']"
        >导出
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-upload2"
          size="mini"
          :disabled="multiple"
          @click="handleSyncData"
          v-hasPermi="['business:task:syncData']"
        >推送数据
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" fixed/>
      <el-table-column label="任务名称" align="center" prop="taskName" min-width="180" show-overflow-tooltip/>
      <el-table-column label="调研水体名称" align="center" prop="surveyWaterBodyName">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.survey_water_body_name" :value="scope.row.surveyWaterBodyName"/>
        </template>
      </el-table-column>
      <el-table-column label="业务类别" align="center" prop="businessType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.task_business_type" :value="scope.row.businessType"/>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
      <el-table-column label="任务描述" align="center" prop="taskRemark">
        <template slot-scope="scope">
          <div v-html="scope.row.taskRemark"></div>
          <!--          {{scope.row.taskRemark}}-->
        </template>
      </el-table-column>
      <!--      <el-table-column label="备注" align="center" prop="remark"/>-->
<!--      <el-table-column label="审核状态" align="center" prop="auditStatus">-->
<!--        <template slot-scope="scope">-->
<!--          <el-popover trigger="hover" placement="top">-->
<!--            <p>审核时间: {{ scope.row.auditTime }}</p>-->
<!--            <p v-if="scope.row.auditStatus === 3">驳回原因: {{ scope.row.reasonRejection }}</p>-->
<!--            <div slot="reference" class="name-wrapper">-->
<!--              <dict-tag :options="dict.type.task_audit_status" :value="scope.row.auditStatus"/>-->
<!--            </div>-->
<!--          </el-popover>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <!--      <el-table-column label="审核时间" align="center" prop="auditTime" width="180"/>-->
      <!--      <el-table-column label="驳回原因" align="center" prop="reasonRejection"/>-->
      <el-table-column label="数据来源" align="center" prop="source" fixed="right">
        <template slot-scope="scope">
          <el-tag :type="scope.row.source == '0'?'warning':'danger'">{{ scope.row.source == '0' ? "后台" : "APP" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="推送状态" align="center" prop="syncStatus" fixed="right">
        <template slot-scope="scope">
          {{ scope.row.syncStatus == 1 ? "已同步" : (scope.row.syncStatus == 2?'同步中':'未同步')}}
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['business:task:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['business:task:remove']"
          >删除
          </el-button>
          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
                       v-hasPermi="['business:task:submit', 'business:task:audit', 'business:task:end', 'business:task:syncData']">
                <span class="el-dropdown-link">
                  <i class="el-icon-d-arrow-right el-icon--right"></i>更多
                </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="handleSurveyInfo" icon="el-icon-info"
                                v-hasPermi="['business:task:survey-info']">调研信息
              </el-dropdown-item>
              <!--              <el-dropdown-item command="handleSubmit" icon="el-icon-document"-->
              <!--                                v-hasPermi="['business:task:submit']" v-if="scope.row.auditStatus === 0">提交任务</el-dropdown-item>-->
              <el-dropdown-item command="handleAudit" icon="el-icon-info"
                                v-hasPermi="['business:task:audit']" v-if="scope.row.auditStatus === 1">审核任务
              </el-dropdown-item>
              <el-dropdown-item command="handleSyncData" icon="el-icon-upload2" v-if="scope.row.syncStatus === 0"
                                v-hasPermi="['business:task:syncData']">推送数据
              </el-dropdown-item>
              <!--              <el-dropdown-item command="handleEndTask" icon="el-icon-s-flag"-->
              <!--                                v-hasPermi="['business:task:end']" v-if="scope.row.auditStatus === 2">结束任务</el-dropdown-item>-->
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改任务对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="任务名称" prop="taskName">
              <el-input v-model="form.taskName" placeholder="请输入任务名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="调研计划" prop="researchPlanId">
              <el-select v-model="form.researchPlanId" placeholder="请选择调研计划" clearable  @change="handleChange">
                <el-option
                  v-for="plan in researchPlanList"
                  :key="plan.id"
                  :label="plan.name"
                  :value="plan.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="调研水体名称" prop="surveyWaterBodyName">
              <el-select v-model="form.surveyWaterBodyName" placeholder="请选择调研水体名称">
                <el-option
                  v-for="dict in dict.type.survey_water_body_name"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="业务类别" prop="businessType">
              <el-select v-model="form.businessType" placeholder="请选择业务类别">
                <el-option
                  v-for="dict in dict.type.task_business_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="分配用户" prop="userIds">
              <el-select v-model="form.userIds" multiple collapse-tags
                         filterable
                         :reserve-keyword="true"
                         placeholder="请选择用户"
              >
                <el-option v-for="(item, index) in userList" :key="index"
                           :label="item.name"
                           :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-divider content-position="left">任务点位</el-divider>
          </el-col>
          <el-col :span="24">
            <el-button @click="addItem" size="mini" round type="primary">增加任务点位</el-button>
          </el-col>
          <el-col :span="24">
            <el-form-item v-for="(pointItem, pointIndex) in form.pointList" :label="'点位-' + (pointIndex + 1)"
                          :key="pointIndex" :prop="'pointList.' + pointIndex + '.pointId'"
            >
              <el-row :gutter="1">
                <el-col :span="7">
                  <el-input v-model="pointItem.pointName" placeholder="请输入点位名称"/>
                </el-col>
                <el-col :span="7">
                  <el-input v-model="pointItem.longitude" placeholder="请输入点位经度"/>
                </el-col>
                <el-col :span="7">
                  <el-input v-model="pointItem.latitude" placeholder="请输入点位纬度"/>
                </el-col>
                <el-col :span="1">
                  <el-button type="danger" icon="el-icon-delete" size="mini" circle
                             @click.prevent="deleteItem(pointItem, pointIndex)"></el-button>
                </el-col>
              </el-row>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="任务描述" prop="taskRemark">
              <editor v-model="form.taskRemark" :min-height="150"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 任务审核弹框 -->
    <el-dialog :visible.sync="auditOpen" title="任务审核">
      <el-form ref="taskAuditForm" :model="taskAuditFormData" :rules="taskAuditRules" size="medium"
               label-width="100px">
        <el-form-item label="审核状态" prop="auditStatus">
          <el-radio-group v-model="taskAuditFormData.auditStatus" size="medium">
            <el-radio v-for="(item, index) in auditStatusOptions" :key="index" :label="item.value"
                      :disabled="item.disabled">{{ item.label }}
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="驳回原因" prop="reasonRejection" v-if="taskAuditFormData.auditStatus === 3">
          <el-input v-model="taskAuditFormData.reasonRejection" type="textarea" placeholder="请输入驳回原因"
                    :maxlength="500" show-word-limit :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}">
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handleConfirm">确定</el-button>
      </div>
    </el-dialog>

    <el-drawer
      :title="surveyInfoTitle"
      :visible.sync="surveyInfoDrawer"
      direction="rtl" size="70%">
      <el-tabs v-model="tabIndex" tab-position="left" @tab-click="pointTabClick">
        <el-tab-pane v-for="(item, index) in taskPointList" :key="item.id" :name="item.index + ''" :label="item.name">
<!--          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"-->
<!--                   label-width="98px">-->
<!--            <el-form-item label="任务名称" prop="taskName">-->
<!--              <el-input-->
<!--                v-model="queryParams.taskName"-->
<!--                placeholder="请输入任务名称"-->
<!--                clearable-->
<!--                @keyup.enter.native="handleQuery"-->
<!--              />-->
<!--            </el-form-item>-->
<!--          </el-form>-->
          <el-table :data="taskSurveyList" style="width: 100%">
            <el-table-column type="expand">
              <template slot-scope="props">
                <el-row :gutter="5">
                  <el-col :xs="12" :sm="12" :md="12" :lg="6" v-if="props.row.list"
                          v-for="(item, index) in props.row.list" :key="item.id">
                    <el-image v-if="item.type === '0'" style="width: 100px; height: 100px" :src="item.fileUrl"
                              :preview-src-list="[item.fileUrl]"></el-image>
<!--                    <el-button-->
<!--                      v-if="item.type === '1'"-->
<!--                      type="success"-->
<!--                      plain-->
<!--                      @click="playVideo(item.fileUrl)"-->
<!--                      ref="btn"-->
<!--                      size="mini"-->
<!--                    >-->
<!--                      播 放-->
<!--                    </el-button>-->
                    <i v-if="item.type === '1'" class="el-icon-video-camera-solid" @click="playVideo(item.fileUrl)"></i>
                  </el-col>
                </el-row>
              </template>
            </el-table-column>
            <el-table-column label="用户" prop="userName"/>
            <el-table-column label="调研说明" prop="remark"/>
<!--            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">-->
<!--              <template slot-scope="scope">-->
<!--                <el-button-->
<!--                  size="mini"-->
<!--                  type="text"-->
<!--                  icon="el-icon-edit"-->
<!--                  @click="handleUpdate(scope.row)"-->
<!--                >审核-->
<!--                </el-button>-->
<!--              </template>-->
<!--            </el-table-column>-->
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </el-drawer>

    <!-- 视频 -->
    <el-dialog title="视频预览" :visible.sync="dialogPlay" width="30%" @close="closeDialog">
      <video
        :src="videoUrl"
        controls
        autoplay
        class="video"
        width="100%"
      ></video>
    </el-dialog>
  </div>
</template>

<script>

import {
  listTask,
  getTask,
  delTask,
  addTask,
  updateTask,
  submitTask,
  auditTask,
  endTask,
  getPointByTask,
  getSurveyByPointId, exportTaskZip,
  selectTaskUser,
  syncTaskData
} from "@/api/business/task";
import {selectResearchPlan} from "@/api/business/researchPlan";

export default {
  name: "Task",
  dicts: ['survey_water_body_name', 'task_audit_status', 'task_business_type'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 任务表格数据
      taskList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        taskName: null,
        surveyWaterBodyName: null,
        businessType: null,
        taskRemark: null,
        auditStatus: null,
        reasonRejection: null,
        auditTime: null,
        source: null,
        researchPlanId: null,
      },
      // 表单参数
      form: {
        userIds: [],
      },
      // 表单校验
      rules: {
        taskName: [
          {required: true, message: "任务名称不能为空", trigger: "blur"}
        ],
        surveyWaterBodyName: [
          {required: true, message: "调研水体名称不能为空", trigger: "blur"}
        ],
        researchPlanId: [
          {required: true, message: "调研计划不能为空", trigger: "blur"}
        ],
        businessType: [
          {required: true, message: "业务类别不能为空", trigger: "change"}
        ],
        userIds: [{required: true, message: '分配用户不能为空', trigger: 'change'}],
      },
      sourceOptions: [{
        value: '0',
        label: '后台'
      }, {
        value: '1',
        label: 'APP'
      }],
      userList: [],
      selectUserName: '',
      auditOpen: false,
      taskAuditFormData: {
        id: null,
        auditStatus: 2,
        reasonRejection: undefined,
      },
      taskAuditRules: {
        auditStatus: [{
          required: true,
          message: '审核状态不能为空',
          trigger: 'change'
        }],
        reasonRejection: [],
      },
      auditStatusOptions: [{
        "label": "通过",
        "value": 2
      }, {
        "label": "驳回",
        "value": 3
      }],
      researchPlanList: [],
      surveyInfoTitle: '',
      surveyInfoDrawer: false,
      taskPointList: [],
      tabIndex: '0',
      taskSurveyList: [],
      dialogPlay: false,
      videoUrl: '',
      previewSrcList: '',
    };
  },
  created() {
    this.getList();
    this.selectResearchPlan();
  },
  methods: {
    /** 查询任务列表 */
    getList() {
      this.loading = true;
      listTask(this.queryParams).then(response => {
        this.taskList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        taskName: null,
        surveyWaterBodyName: null,
        businessType: null,
        taskRemark: null,
        remark: null,
        userIds: [],
        pointList: [{
          id: null,
          pointName: null,
          longitude: null,
          latitude: null
        }],
        researchPlanId: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加任务";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getTask(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改任务";
        this.getSelectUser(this.form.researchPlanId);
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateTask(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addTask(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除任务编号为"' + ids + '"的数据项？').then(function () {
        return delTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    handleSyncData(row){
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认推送任务编号为"' + ids + '"的数据项？').then(function () {
        return syncTaskData(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("同步已提交");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      // this.download('business/task/export', {
      //   ...this.queryParams
      // }, `task_${new Date().getTime()}.xlsx`)
      exportTaskZip(this.queryParams).then(res => {
        //导出文件名
        let filename = new Date().getTime();
        //创建url
        let url = window.URL.createObjectURL(res)
        //创建a标签 并设置属性
        let link = document.createElement('a')
        link.style.display = 'none'
        link.href = url
        link.setAttribute('download', filename + '.zip')
        //添加a标签
        document.body.appendChild(link)
        //执行下载
        link.click();
        //释放url对象
        URL.revokeObjectURL(link.href);
        //释放a标签
        document.body.removeChild(link);
      });
    },
    handleChange(value){
      this.form.userIds=[]
      if(value) {
        this.getSelectUser(value);
      }
    },
    getSelectUser(planId) {
      let queryUser = {
        name: this.selectUserName,
        planId: planId
      }
      selectTaskUser(queryUser).then(res => {
        this.userList = res.data
      })
    },
    addItem() {
      this.form.pointList.push({
        id: null,
        pointName: null,
        longitude: null,
        latitude: null
      })
    },
    deleteItem(pointItem, index) {
      this.form.pointList.splice(index, 1)
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleSurveyInfo":
          this.handleSurveyInfo(row);
          break;
        case "handleSubmit":
          this.handleSubmit(row);
          break;
        case "handleAudit":
          this.handleAudit(row);
          break;
        case "handleEndTask":
          this.handleEndTask(row);
          break;
        case "handleSyncData":
          this.handleSyncData(row)
          break;
        default:
          break;
      }
    },
    handleSubmit(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认提交任务编号为"' + ids + '"的数据项？').then(function () {
        return submitTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("提交成功");
      }).catch(() => {
      });
    },
    handleAudit(row) {
      this.taskAuditFormData.id = row.id;
      this.auditOpen = true;
    },
    handleEndTask(row) {

    },
    close() {
      this.$refs['taskAuditForm'].resetFields()
      this.auditOpen = false;
    },
    handleConfirm() {
      this.$refs['taskAuditForm'].validate(valid => {
        if (!valid) {
          return
        }
        auditTask(this.taskAuditFormData).then(res => {
          this.$modal.msgSuccess("审核成功");
          this.close()
          this.getList();
        });
      })
    },
    selectResearchPlan() {
      selectResearchPlan().then(res => {
        this.researchPlanList = res.data
      });
    },
    handleSurveyInfo(row) {
      console.log('row---', row)
      this.surveyInfoTitle = row.taskName + '调研详情';
      this.getPointByTask(row.id);
      this.surveyInfoDrawer = true;
    },
    getPointByTask(taskId) {
      getPointByTask(taskId).then(res => {
        this.taskPointList = res.data;
        console.log('-getPointByTask--tabIndex-----', this.tabIndex)
        let taskPoint = this.taskPointList[this.tabIndex];
        this.getSurveyByPointId(taskPoint.id, {});
      });
    },
    pointTabClick(tab) {
      console.log('tab-----', tab)
      console.log('tabIndex-----', this.tabIndex)
    },
    getSurveyByPointId(pointId, query) {
      getSurveyByPointId(pointId, query).then(res => {
        this.taskSurveyList = res.data;
      });
    },
    // 视频
    playVideo(url) {
      this.dialogPlay = true;
      this.videoUrl = url;
    },
    closeDialog() {
      this.videoUrl = ""; //清空数据 关闭视频播放
    },
  }
};
</script>
